home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / progs / prelude / PreludeTuplePrims.hi < prev    next >
Encoding:
Text File  |  1994-09-27  |  1.3 KB  |  46 lines  |  [TEXT/YHS2]

  1.  
  2. -- This is the interface to the primitives used to implement arbitrary
  3. -- sized tuples.
  4.  
  5. interface PreludeTuplePrims where
  6.  
  7. {-# Prelude #-}
  8.  
  9.  
  10. import PreludeTuple(Tuple,TupleDicts)
  11.  
  12. -- The type checker fiddles around with the call to dictSel to use the
  13. -- dictionary to resolve the overloading of a subexpression.  The call
  14. -- dictSel (exp dict i) will typecheck exp and use the ith component of
  15. -- the tupleDict dict to resolve the overloading.  No check is made to ensure
  16. -- that the type of the dictionary matches the overloaded class!  Beware!
  17.  
  18. tupleSize :: TupleDicts -> Int
  19. tupleSel :: Tuple -> Int -> Int -> a
  20. dictSel :: TupleDicts -> Int -> a
  21. listToTuple :: [a] -> Tuple
  22. -- These are not called by haskell code directly; these are introduced
  23. -- during dictionary conversion by the type checker.
  24. tupleEqDict :: a
  25. tupleOrdDict :: a
  26. tupleIxDict :: a
  27. tupleTextDict :: a
  28. tupleBinaryDict :: a
  29.  
  30. {-#
  31. tupleSize ::       LispName("prim.tupleSize"), Complexity(1)
  32. tupleSel ::        LispName("prim.tupleSel")
  33. dictSel ::         LispName("prim.dict-sel")
  34. listToTuple ::     LispName("prim.list->tuple"), NoConversion
  35. tupleEqDict ::     LispName("prim.tupleEqDict")
  36. tupleOrdDict ::    LispName("prim.tupleOrdDict")
  37. tupleIxDict ::     LispName("prim.tupleIxDict")
  38. tupleTextDict ::   LispName("prim.tupleTextDict")
  39. tupleBinaryDict :: LispName("prim.tupleBinaryDict")
  40.  
  41. #-}
  42.  
  43.  
  44.  
  45.  
  46.